package com.caizi.designpattern.factory.abstractfactory;

public class ComputeEngineer {

    public void makeCompute(AbsPCFactory schemal) throws Exception {
        if (!schemal.isCompatible()) {
            throw new Exception("CPU and MainBoard is not Compatible");
        }
        ICPU cpuImpl = schemal.createCPUImpl();
        IMainBoard mainBoardImpl = schemal.createMainBoardImpl();
        cpuImpl.calculate();
        mainBoardImpl.installCPU();
    }
}
